package GUILayer;

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.Color;
import java.awt.Label;
import java.awt.Font;
import java.awt.TextField;
import java.awt.Checkbox;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import javax.swing.UIManager;
import java.awt.Button;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JTextField;
import javax.swing.JList;
import javax.swing.JScrollPane;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;

public class Salg {

	private JFrame frame;
	private JTextField textField_8;
	private JTable table;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Salg window = new Salg();
					window.frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public Salg() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frame = new JFrame();
		frame.setBounds(100, 100, 840, 450);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.getContentPane().setLayout(null);
		
		JPanel panel = new JPanel();
		panel.setBackground(Color.WHITE);
		panel.setBounds(10, 100, 220, 312);
		frame.getContentPane().add(panel);
		panel.setLayout(null);
		
		Label label_4 = new Label("Fornavn:");
		label_4.setBounds(10, 10, 62, 22);
		panel.add(label_4);
		
		TextField textField = new TextField();
		textField.setBounds(78, 10, 132, 22);
		panel.add(textField);
		
		TextField textField_1 = new TextField();
		textField_1.setBounds(78, 38, 132, 22);
		panel.add(textField_1);
		
		Label label_5 = new Label("Efternavn:");
		label_5.setBounds(10, 38, 62, 22);
		panel.add(label_5);
		
		TextField textField_2 = new TextField();
		textField_2.setBounds(78, 66, 132, 22);
		panel.add(textField_2);
		
		Label label_6 = new Label("Adresse:");
		label_6.setBounds(10, 66, 62, 22);
		panel.add(label_6);
		
		TextField textField_3 = new TextField();
		textField_3.setBounds(78, 94, 132, 22);
		panel.add(textField_3);
		
		Label label_7 = new Label("Telefon:");
		label_7.setBounds(10, 94, 62, 22);
		panel.add(label_7);
		
		TextField textField_4 = new TextField();
		textField_4.setBounds(78, 122, 132, 22);
		panel.add(textField_4);
		
		Label label_8 = new Label("E-Mail:");
		label_8.setBounds(10, 122, 62, 22);
		panel.add(label_8);
		
		Checkbox checkbox = new Checkbox("Erhverv");
		checkbox.setBounds(10, 158, 95, 22);
		panel.add(checkbox);
		
		Checkbox checkbox_1 = new Checkbox("Privat");
		checkbox_1.setBounds(115, 158, 95, 22);
		panel.add(checkbox_1);
		
		Label label_9 = new Label("*Erhverv");
		label_9.setFont(new Font("Dialog", Font.BOLD | Font.ITALIC, 12));
		label_9.setBounds(10, 186, 62, 22);
		panel.add(label_9);
		
		Label label_10 = new Label("Firmanavn:");
		label_10.setBounds(10, 204, 62, 22);
		panel.add(label_10);
		
		TextField textField_5 = new TextField();
		textField_5.setBounds(78, 204, 132, 22);
		panel.add(textField_5);
		
		Label label_11 = new Label("CVR:");
		label_11.setBounds(10, 232, 62, 22);
		panel.add(label_11);
		
		TextField textField_6 = new TextField();
		textField_6.setBounds(78, 232, 132, 22);
		panel.add(textField_6);
		
		Label label_12 = new Label("Firma Adr:");
		label_12.setBounds(10, 260, 62, 22);
		panel.add(label_12);
		
		TextField textField_7 = new TextField();
		textField_7.setBounds(78, 260, 132, 22);
		panel.add(textField_7);
		
		Button button = new Button("Opret og V\u00E6lg");
		button.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
			}
		});
		button.setBounds(125, 288, 85, 15);
		panel.add(button);
		
		Label label = new Label("Ny Kunde");
		label.setFont(new Font("Dialog", Font.BOLD, 13));
		label.setBounds(10, 76, 62, 22);
		frame.getContentPane().add(label);
		
		Label label_1 = new Label("Kunde");
		label_1.setFont(new Font("Dialog", Font.BOLD, 13));
		label_1.setBounds(240, 76, 62, 22);
		frame.getContentPane().add(label_1);
		
		JPanel panel_1 = new JPanel();
		panel_1.setBackground(Color.WHITE);
		panel_1.setBounds(240, 100, 352, 312);
		frame.getContentPane().add(panel_1);
		panel_1.setLayout(null);
		
		textField_8 = new JTextField();
	/*	textField_8.addKeyListener(new KeyAdapter(ENTER) {
			@Override
			public void keyPressed(KeyEvent arg0) {
			}
		});
		*/
		textField_8.setBounds(10, 38, 86, 20);
		panel_1.add(textField_8);
		textField_8.setColumns(10);
		
		Label label_13 = new Label("S\u00F8g efter kunde");
		label_13.setBounds(10, 10, 102, 22);
		panel_1.add(label_13);
		
		Button button_1 = new Button("S\u00F8g");
		button_1.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent arg0) {
			}
		});
		button_1.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
			}
		});
		button_1.setBounds(102, 38, 70, 20);
		panel_1.add(button_1);
		
		JScrollPane scrollPane = new JScrollPane();
		scrollPane.setEnabled(false);
		scrollPane.setBounds(10, 86, 332, 105);
		panel_1.add(scrollPane);
		
		table = new JTable();
		table.setEnabled(false);
		table.setRowSelectionAllowed(false);
		table.setModel(new DefaultTableModel(
			new Object[][] {
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
			},
			new String[] {
				"Navn", "Nummer", "Erhverv / Privat"
			}
		));
		scrollPane.setViewportView(table);
		
		Label label_2 = new Label("Afslut Ordre");
		label_2.setFont(new Font("Dialog", Font.BOLD, 13));
		label_2.setBounds(600, 76, 81, 22);
		frame.getContentPane().add(label_2);
		
		JPanel panel_2 = new JPanel();
		panel_2.setBackground(Color.WHITE);
		panel_2.setBounds(602, 100, 220, 312);
		frame.getContentPane().add(panel_2);
		panel_2.setLayout(null);
		
		JPanel panel_3 = new JPanel();
		panel_3.setBorder(UIManager.getBorder("Tree.editorBorder"));
		panel_3.setBackground(Color.WHITE);
		panel_3.setBounds(10, 5, 200, 270);
		panel_2.add(panel_3);
		panel_3.setLayout(null);
		
		JList list = new JList();
		list.setBounds(10, 94, 180, -82);
		panel_3.add(list);
		
		Button button_2 = new Button("Afslut handel og udskriv faktura");
		button_2.setBounds(48, 280, 162, 15);
		panel_2.add(button_2);
		
		Label label_3 = new Label("Vestbjerg Byggecenter A/S");
		label_3.setAlignment(Label.CENTER);
		label_3.setFont(new Font("Dialog", Font.BOLD, 25));
		label_3.setBounds(180, 10, 333, 39);
		frame.getContentPane().add(label_3);
	}
	public void setVisible(boolean visible)
	{
		frame.setVisible(visible);
	}
}
